<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎莅临 ZENBOSS白板</title>
<link href="/templates/dialog/storage/css/default.css" rel="stylesheet" type="text/css" />
<style>
.login_box{
	float:left;
	border:2px solid #ccc;
	width:165px;
	height:auto;
	padding:20px;
	}
.txt_input{
	width:250px;
	border:1px solid #bbb;
	padding:2px;
	}
</style>
<script type="text/javascript" src="/templates/dialog/storage/js/common.js"></script>
<script type="text/javascript">



function mouseMove(ev){
    var ev1 =ev;
    alert(ev1.x);
    //var mousePos = mousePosition(ev);
} 


</script>

</head>
<body>

<?php include('head.php') ?>




<div class="body">
<table cellspacing="0" width="100%">
	
	<?php if(empty($__ITEMS['login_user'])) : //如果没有登陆?>
		<?php foreach ($__ITEMS['dialog'] as $a):?>
		<tr>
			<td align="center" style="width:100px;">
				<a href="/user.php?uid=<?php echo $a['user_tid'] ?>"><img border="0" src="<?php echo tools_pick_Value__($a['user_image'],'/templates/dialog/storage/img/no_img.jpg') ?>" width="52" height="52" onerror="this.src='/templates/dialog/storage/img/no_img.jpg'" /></a>
				<br />
				<?php echo $a['user_name'],'(',$a['user_nickname'],')' ?>
			</td>
			<td><?php echo ($a['dialog_topic_content']) ?><br /><br /><span class="time_txt"><?php echo date('Y-m-d H:i:s',$a['dialog_topic_add_time']) ?></span></td>
		</tr>
		<tr><td colspan="2"><hr size="1" style="height:1px;" /></td></tr>
		
	
	
		
		<?php endforeach; ?>
	<?php else : //如果登陆了?>
		<tr bgcolor="#e5ecf0">
			<td colspan="2" align="right">来说句话吧,让所有关注你的人听到:
			<form method="POST" style="margin: 0px; display: inline;" action="/reply.php?do=reply_do"  ><input type="text" name="content" class="form_text" style="width:400px;">&nbsp;<input class="form_btn" style="height:25px;" type="submit" value="说" /></form>
			</td>
		</tr>
		<tr><td colspan="2"><hr size="1" style="height:1px;" /></td></tr>	
		<?php foreach ($__ITEMS['dialog'] as $a):?>
		<tr>
			<td valign="top" align="center" style="width:100px;">
				<a href="/user.php?uid=<?php echo $a['user_tid'] ?>"><img border="0" src="<?php echo tools_pick_Value__($a['user_image'],'/templates/dialog/storage/img/no_img.jpg') ?>" width="52" height="52" onerror="this.src='/templates/dialog/storage/img/no_img.jpg'" /></a>
				<br />
				<?php echo $a['user_name'],'(',$a['user_nickname'],')' ?>
			</td>
			<?php
			//判断背景颜色
			$content_color = '';
//			var_dump($a['dialog_topic_to_user_tid']);exit;
				//如果收件人是自己,或者如果收件人不为0且发件人是自己
				if ($a['dialog_topic_to_user_tid']==$__ITEMS['login_user']['user_tid']
						|| ($a['dialog_topic_to_user_tid']!=0 
								&& $a['dialog_topic_author_user_tid']==$__ITEMS['login_user']['user_tid']
							)
					) {
					$content_color='bgcolor=#ffffcc';
				}else if(strpos($a['dialog_topic_content'],'>'.$__ITEMS['login_user']['user_name'].'<')){
					$content_color='bgcolor=#E5FCF9';
				}
			
			?>
			<td <?php echo $content_color?>>
				<div>
					<?php echo ($a['dialog_topic_content']) ?>
					<br /><br /><span class="time_txt"><?php echo date('Y-m-d H:i:s',$a['dialog_topic_add_time']) ?></span>&nbsp;-&nbsp;
					<?php if ($a['dialog_topic_author_user_tid']!=$__ITEMS['login_user']['user_tid']) ://如果发件人不是自己,才可以回复或对话?>
					<a onclick="add_reply_textbox(<?php echo $a['dialog_topic_tid'],',',$a['dialog_topic_tid'],',0' ?>);return false;" href='javascript:void(0)'>回复</a>
					/
					<a href='javascript:void(0)' onclick="add_reply_textbox(<?php echo $a['dialog_topic_tid'],',',$a['dialog_topic_tid'],',1' ?>);return false;" >对话</a>
					<?php endif; ?>
				</div>
				<div id="<?php echo $a['dialog_topic_tid'] ?>"></div>
			</td>
		</tr>
		<tr><td colspan="2"><hr size="1" style="height:1px;" /></td></tr>
		
	
	
		
		<?php endforeach; ?>
		
	<?php endif;?>
	
	
</table>
</div>


<?php include('foot.php') ?>

</body>
</html>
